from typing import *
from leetcode.editor.common.node import *


# leetcode submit region begin(Prohibit modification and deletion)
class Solution:
    def numOfSubarrays(self, arr: List[int], k: int, threshold: int) -> int:
        ans = vowal = 0
        for right,n in enumerate(arr):
            vowal += n

            left = right-k+1
            if left <0:
                continue
            if vowal/k >= threshold:
                ans +=1
            vowal -= arr[left]
        return ans
# leetcode submit region end(Prohibit modification and deletion)


if __name__ == '__main__':
    solution = Solution()
    # your test code here